﻿@model EM.OA.Portal.Models.TaskModels
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}
<script type="text/javascript" src="~/Scripts/page/Project/Task.js"></script>
<div class="easyui-layout" style="height: 500px; overflow: hidden;">
    <div data-options="region:'west',split:true,title:'任务管理'" style="width: 150px; padding: 10px;">
        <ul id="tree" class="easyui-tree">
        </ul>
    </div>
    <div data-options="region:'center',title:''">
        @*list*@
        <table id="list" class="easyui-datagrid" toolbar="#toolbar">
        </table>
    </div>
</div>
<div id="toolbar">
    <a href="#" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="add()">增加</a>
    <a href="#" class="easyui-linkbutton" iconcls="icon-edit" plain="true" onclick="edit()">修改</a>
    <a href="#" class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="del()">删除</a>
    <div id="tb" style="padding: 3px">
        <span>@Html.LabelFor(m => m.Title)</span>
        <input id="Title" name="Title">
        @Html.DropDownList("QStatus", new EM.OA.Portal.Models.WorkPlanModels().GetListItems("TaskStatus"), new { @class = "easyui-combobox" })
        <a href="#" class="easyui-linkbutton" plain="true" onclick="doSearch()">查询</a>
    </div>
</div>

@*Detail*@
<div id="dlg" class="easyui-dialog" style="width: 800px; height: 500px; padding: 10px 20px"
    closed="true" buttons="#dlg-buttons" modal="true" data-options="
    onOpen:function() { 
    keditor =  KindEditor.create('#Description',{
    items : [
						'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
						'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
						'insertunorderedlist', '|', 'emoticons', 'image', 'link']    }); 

     },
    onBeforeClose:function() { 
    keditor.html(''); 
    keditor.remove('#Description');
    }
    ">
    <div id="dlg-buttons">
        <a href="#" class="easyui-linkbutton" iconcls="icon-ok" onclick="save()">保存</a>
        <a href="#" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">取消</a>
    </div>
    <form id="fm" method="post">
        @Html.HiddenFor(m => m.TaskID)
        @Html.Hidden("refID", @ViewData["refID"].ToString())
        <table>
            <tr>
                <td>@Html.LabelFor(m => m.Title)</td>
                <td>@Html.TextBoxFor(m => m.Title, new { @class = "easyui-validatebox", @required = "true" })</td>
                <td>@Html.LabelFor(m => m.Status)</td>
                <td>@Html.DropDownListFor(m => m.Status, new EM.OA.Portal.Models.WorkPlanModels().GetListItems("TaskStatus"), new { @class = "easyui-combobox" })
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.FinishTime)</td>
                <td>@Html.TextBoxFor(m => m.FinishTime, new { @class = "easyui-datebox" })
                </td>
                <td>@Html.LabelFor(m => m.IsASAP)</td>
                <td>@Html.CheckBoxFor(m => m.IsASAP)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.Priority)</td>
                <td>@Html.DropDownListFor(m => m.Priority, new EM.OA.Portal.Models.WorkPlanModels().GetListItems("TaskLevelKind"), new { @class = "easyui-combobox" })
                </td>
                <td>@Html.LabelFor(m => m.FinishPercent)</td>
                <td>@Html.TextBoxFor(m => m.FinishPercent, new { @class = "easyui-numberbox", @min = "0", @max = "100" })</td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.Description)</td>
                <td colspan="3">
                    <textarea id="Description" name="Description" style="width: 500px; height: 300px;" required="true" class="easyui-validatebox"></textarea>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <iframe id="frmUploadFile" style="border: 0px; width: 100%;" src="Attachment/Index?refID=@ViewData["refID"]"></iframe>
                </td>
            </tr>
            @* <tr>
                <td>@Html.Label("任务相关人员")</td>
            </tr>*@
            <tr>
                <td>@Html.Label("管理人")</td>
                <td>
                    <input type="hidden" id="ManageUserID" name="ManageUserID" />
                    <input class="easyui-validatebox" type="text" id="ManageUserIDName" name="ManageUserIDName" />
                    <a href="#" class="easyui-linkbutton" onclick="GetUserList()" plain="true">选择</a>

                </td>
            </tr>
            <tr>
                <td>@Html.Label("参与人")</td>
                <td>
                    <input type="hidden" id="JoinUserIDs" name="JoinUserIDs" />
                    <input class="easyui-validatebox" type="text" id="JoinUserIDsName" name="JoinUserIDsName" />
                    <a href="#" class="easyui-linkbutton" onclick="GetUserListMulti()" plain="true">选择</a>

                </td>
            </tr>

        </table>

    </form>
</div>
@Html.Partial("_OrgUserPartial", new List<object> { true, "ManageUserID", "ManageUserIDName" })
@Html.Partial("_OrgUserMultiPartial", new List<object> { "JoinUserIDs", "JoinUserIDsName" })



